package demo.file;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;

import org.apache.commons.fileupload.util.Streams;


public class WhiteFile {

	
	
	public static void main(String[] argv) throws Exception {
//		1.获取指定地址的输入流.
		URL url = new URL("url");
		InputStream in = url.openStream();

//		2.在指定文件夹下创建文件。
		File dir = new File("指定文件夹");
		File file = new File(dir,"文件名");

//		3.将下载保存到文件。
		FileOutputStream out = new FileOutputStream(file);
		Streams.copy(in, out, true);
	 }
		 
}
